/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package net.jonbuck.tassoo.model.impl;

import net.jonbuck.tassoo.model.AttachmentTypes;
import net.jonbuck.tassoo.model.Categories;
import net.jonbuck.tassoo.model.Containers;
import net.jonbuck.tassoo.model.Priorities;
import net.jonbuck.tassoo.model.Statuses;
import net.jonbuck.tassoo.model.Tassoo;
import net.jonbuck.tassoo.model.TassooPackage;
import net.jonbuck.tassoo.model.Types;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Tassoo</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link net.jonbuck.tassoo.model.impl.TassooImpl#getAttachmentTypes <em>Attachment Types</em>}</li>
 *   <li>{@link net.jonbuck.tassoo.model.impl.TassooImpl#getCategories <em>Categories</em>}</li>
 *   <li>{@link net.jonbuck.tassoo.model.impl.TassooImpl#getContainers <em>Containers</em>}</li>
 *   <li>{@link net.jonbuck.tassoo.model.impl.TassooImpl#getDescription <em>Description</em>}</li>
 *   <li>{@link net.jonbuck.tassoo.model.impl.TassooImpl#getFilePath <em>File Path</em>}</li>
 *   <li>{@link net.jonbuck.tassoo.model.impl.TassooImpl#getName <em>Name</em>}</li>
 *   <li>{@link net.jonbuck.tassoo.model.impl.TassooImpl#getPriorities <em>Priorities</em>}</li>
 *   <li>{@link net.jonbuck.tassoo.model.impl.TassooImpl#getStatuses <em>Statuses</em>}</li>
 *   <li>{@link net.jonbuck.tassoo.model.impl.TassooImpl#getTypes <em>Types</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class TassooImpl extends EObjectImpl implements Tassoo {
	/**
	 * The cached value of the '{@link #getAttachmentTypes() <em>Attachment Types</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAttachmentTypes()
	 * @generated
	 * @ordered
	 */
	protected AttachmentTypes attachmentTypes;

	/**
	 * The cached value of the '{@link #getCategories() <em>Categories</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCategories()
	 * @generated
	 * @ordered
	 */
	protected Categories categories;

	/**
	 * The cached value of the '{@link #getContainers() <em>Containers</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getContainers()
	 * @generated
	 * @ordered
	 */
	protected Containers containers;

	/**
	 * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDescription()
	 * @generated
	 * @ordered
	 */
	protected static final String DESCRIPTION_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDescription()
	 * @generated
	 * @ordered
	 */
	protected String description = DESCRIPTION_EDEFAULT;

	/**
	 * The default value of the '{@link #getFilePath() <em>File Path</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFilePath()
	 * @generated
	 * @ordered
	 */
	protected static final String FILE_PATH_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getFilePath() <em>File Path</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFilePath()
	 * @generated
	 * @ordered
	 */
	protected String filePath = FILE_PATH_EDEFAULT;

	/**
	 * The default value of the '{@link #getName() <em>Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName()
	 * @generated
	 * @ordered
	 */
	protected static final String NAME_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName()
	 * @generated
	 * @ordered
	 */
	protected String name = NAME_EDEFAULT;

	/**
	 * The cached value of the '{@link #getPriorities() <em>Priorities</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPriorities()
	 * @generated
	 * @ordered
	 */
	protected Priorities priorities;

	/**
	 * The cached value of the '{@link #getStatuses() <em>Statuses</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getStatuses()
	 * @generated
	 * @ordered
	 */
	protected Statuses statuses;

	/**
	 * The cached value of the '{@link #getTypes() <em>Types</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTypes()
	 * @generated
	 * @ordered
	 */
	protected Types types;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected TassooImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return TassooPackage.Literals.TASSOO;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AttachmentTypes getAttachmentTypes() {
		return attachmentTypes;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetAttachmentTypes(AttachmentTypes newAttachmentTypes, NotificationChain msgs) {
		AttachmentTypes oldAttachmentTypes = attachmentTypes;
		attachmentTypes = newAttachmentTypes;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TassooPackage.TASSOO__ATTACHMENT_TYPES, oldAttachmentTypes, newAttachmentTypes);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setAttachmentTypes(AttachmentTypes newAttachmentTypes) {
		if (newAttachmentTypes != attachmentTypes) {
			NotificationChain msgs = null;
			if (attachmentTypes != null)
				msgs = ((InternalEObject)attachmentTypes).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TassooPackage.TASSOO__ATTACHMENT_TYPES, null, msgs);
			if (newAttachmentTypes != null)
				msgs = ((InternalEObject)newAttachmentTypes).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TassooPackage.TASSOO__ATTACHMENT_TYPES, null, msgs);
			msgs = basicSetAttachmentTypes(newAttachmentTypes, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TassooPackage.TASSOO__ATTACHMENT_TYPES, newAttachmentTypes, newAttachmentTypes));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDescription(String newDescription) {
		String oldDescription = description;
		description = newDescription;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TassooPackage.TASSOO__DESCRIPTION, oldDescription, description));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getFilePath() {
		return filePath;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setFilePath(String newFilePath) {
		String oldFilePath = filePath;
		filePath = newFilePath;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TassooPackage.TASSOO__FILE_PATH, oldFilePath, filePath));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getName() {
		return name;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setName(String newName) {
		String oldName = name;
		name = newName;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TassooPackage.TASSOO__NAME, oldName, name));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Containers getContainers() {
		return containers;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetContainers(Containers newContainers, NotificationChain msgs) {
		Containers oldContainers = containers;
		containers = newContainers;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TassooPackage.TASSOO__CONTAINERS, oldContainers, newContainers);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setContainers(Containers newContainers) {
		if (newContainers != containers) {
			NotificationChain msgs = null;
			if (containers != null)
				msgs = ((InternalEObject)containers).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TassooPackage.TASSOO__CONTAINERS, null, msgs);
			if (newContainers != null)
				msgs = ((InternalEObject)newContainers).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TassooPackage.TASSOO__CONTAINERS, null, msgs);
			msgs = basicSetContainers(newContainers, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TassooPackage.TASSOO__CONTAINERS, newContainers, newContainers));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Categories getCategories() {
		return categories;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetCategories(Categories newCategories, NotificationChain msgs) {
		Categories oldCategories = categories;
		categories = newCategories;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TassooPackage.TASSOO__CATEGORIES, oldCategories, newCategories);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCategories(Categories newCategories) {
		if (newCategories != categories) {
			NotificationChain msgs = null;
			if (categories != null)
				msgs = ((InternalEObject)categories).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TassooPackage.TASSOO__CATEGORIES, null, msgs);
			if (newCategories != null)
				msgs = ((InternalEObject)newCategories).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TassooPackage.TASSOO__CATEGORIES, null, msgs);
			msgs = basicSetCategories(newCategories, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TassooPackage.TASSOO__CATEGORIES, newCategories, newCategories));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Priorities getPriorities() {
		return priorities;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetPriorities(Priorities newPriorities, NotificationChain msgs) {
		Priorities oldPriorities = priorities;
		priorities = newPriorities;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TassooPackage.TASSOO__PRIORITIES, oldPriorities, newPriorities);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPriorities(Priorities newPriorities) {
		if (newPriorities != priorities) {
			NotificationChain msgs = null;
			if (priorities != null)
				msgs = ((InternalEObject)priorities).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TassooPackage.TASSOO__PRIORITIES, null, msgs);
			if (newPriorities != null)
				msgs = ((InternalEObject)newPriorities).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TassooPackage.TASSOO__PRIORITIES, null, msgs);
			msgs = basicSetPriorities(newPriorities, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TassooPackage.TASSOO__PRIORITIES, newPriorities, newPriorities));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Statuses getStatuses() {
		return statuses;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetStatuses(Statuses newStatuses, NotificationChain msgs) {
		Statuses oldStatuses = statuses;
		statuses = newStatuses;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TassooPackage.TASSOO__STATUSES, oldStatuses, newStatuses);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setStatuses(Statuses newStatuses) {
		if (newStatuses != statuses) {
			NotificationChain msgs = null;
			if (statuses != null)
				msgs = ((InternalEObject)statuses).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TassooPackage.TASSOO__STATUSES, null, msgs);
			if (newStatuses != null)
				msgs = ((InternalEObject)newStatuses).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TassooPackage.TASSOO__STATUSES, null, msgs);
			msgs = basicSetStatuses(newStatuses, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TassooPackage.TASSOO__STATUSES, newStatuses, newStatuses));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Types getTypes() {
		return types;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetTypes(Types newTypes, NotificationChain msgs) {
		Types oldTypes = types;
		types = newTypes;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TassooPackage.TASSOO__TYPES, oldTypes, newTypes);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setTypes(Types newTypes) {
		if (newTypes != types) {
			NotificationChain msgs = null;
			if (types != null)
				msgs = ((InternalEObject)types).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TassooPackage.TASSOO__TYPES, null, msgs);
			if (newTypes != null)
				msgs = ((InternalEObject)newTypes).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TassooPackage.TASSOO__TYPES, null, msgs);
			msgs = basicSetTypes(newTypes, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TassooPackage.TASSOO__TYPES, newTypes, newTypes));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case TassooPackage.TASSOO__ATTACHMENT_TYPES:
				return basicSetAttachmentTypes(null, msgs);
			case TassooPackage.TASSOO__CATEGORIES:
				return basicSetCategories(null, msgs);
			case TassooPackage.TASSOO__CONTAINERS:
				return basicSetContainers(null, msgs);
			case TassooPackage.TASSOO__PRIORITIES:
				return basicSetPriorities(null, msgs);
			case TassooPackage.TASSOO__STATUSES:
				return basicSetStatuses(null, msgs);
			case TassooPackage.TASSOO__TYPES:
				return basicSetTypes(null, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case TassooPackage.TASSOO__ATTACHMENT_TYPES:
				return getAttachmentTypes();
			case TassooPackage.TASSOO__CATEGORIES:
				return getCategories();
			case TassooPackage.TASSOO__CONTAINERS:
				return getContainers();
			case TassooPackage.TASSOO__DESCRIPTION:
				return getDescription();
			case TassooPackage.TASSOO__FILE_PATH:
				return getFilePath();
			case TassooPackage.TASSOO__NAME:
				return getName();
			case TassooPackage.TASSOO__PRIORITIES:
				return getPriorities();
			case TassooPackage.TASSOO__STATUSES:
				return getStatuses();
			case TassooPackage.TASSOO__TYPES:
				return getTypes();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case TassooPackage.TASSOO__ATTACHMENT_TYPES:
				setAttachmentTypes((AttachmentTypes)newValue);
				return;
			case TassooPackage.TASSOO__CATEGORIES:
				setCategories((Categories)newValue);
				return;
			case TassooPackage.TASSOO__CONTAINERS:
				setContainers((Containers)newValue);
				return;
			case TassooPackage.TASSOO__DESCRIPTION:
				setDescription((String)newValue);
				return;
			case TassooPackage.TASSOO__FILE_PATH:
				setFilePath((String)newValue);
				return;
			case TassooPackage.TASSOO__NAME:
				setName((String)newValue);
				return;
			case TassooPackage.TASSOO__PRIORITIES:
				setPriorities((Priorities)newValue);
				return;
			case TassooPackage.TASSOO__STATUSES:
				setStatuses((Statuses)newValue);
				return;
			case TassooPackage.TASSOO__TYPES:
				setTypes((Types)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case TassooPackage.TASSOO__ATTACHMENT_TYPES:
				setAttachmentTypes((AttachmentTypes)null);
				return;
			case TassooPackage.TASSOO__CATEGORIES:
				setCategories((Categories)null);
				return;
			case TassooPackage.TASSOO__CONTAINERS:
				setContainers((Containers)null);
				return;
			case TassooPackage.TASSOO__DESCRIPTION:
				setDescription(DESCRIPTION_EDEFAULT);
				return;
			case TassooPackage.TASSOO__FILE_PATH:
				setFilePath(FILE_PATH_EDEFAULT);
				return;
			case TassooPackage.TASSOO__NAME:
				setName(NAME_EDEFAULT);
				return;
			case TassooPackage.TASSOO__PRIORITIES:
				setPriorities((Priorities)null);
				return;
			case TassooPackage.TASSOO__STATUSES:
				setStatuses((Statuses)null);
				return;
			case TassooPackage.TASSOO__TYPES:
				setTypes((Types)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case TassooPackage.TASSOO__ATTACHMENT_TYPES:
				return attachmentTypes != null;
			case TassooPackage.TASSOO__CATEGORIES:
				return categories != null;
			case TassooPackage.TASSOO__CONTAINERS:
				return containers != null;
			case TassooPackage.TASSOO__DESCRIPTION:
				return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
			case TassooPackage.TASSOO__FILE_PATH:
				return FILE_PATH_EDEFAULT == null ? filePath != null : !FILE_PATH_EDEFAULT.equals(filePath);
			case TassooPackage.TASSOO__NAME:
				return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
			case TassooPackage.TASSOO__PRIORITIES:
				return priorities != null;
			case TassooPackage.TASSOO__STATUSES:
				return statuses != null;
			case TassooPackage.TASSOO__TYPES:
				return types != null;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (description: ");
		result.append(description);
		result.append(", filePath: ");
		result.append(filePath);
		result.append(", name: ");
		result.append(name);
		result.append(')');
		return result.toString();
	}

} //TassooImpl
